import request from '@/router/axios';

export const getRegionList = (parentCode, areaCode) => {
  return request({
    url: '/api/blade-system/regioin/regionList',
    method: 'get',
    params: {
      parentCode,
      areaCode
    }
  })
}

export const filterTreeByKeyWord = (keyword, areaCode) => {
    return request({
        url: '/api/blade-system/regioin/filterTreeByKeyWord',
        method: 'get',
        params: {
            keyword,
            areaCode
        }
    })
}

export const getDefaultExpandedKeys = (parentId) => {
    return request({
        url: '/api/blade-system/regioin/getDefaultExpandedKeys',
        method: 'get',
        params: {
            parentId,
        }
    })
};

export const areaOnlyLazyTree = (parentCode) => {
    return request({
        url: "/api/blade-system/regioin/areaOnlyLazyTree",
        method: "get",
        params: {
            parentCode
        }
    })
};

export const cityAreaTree = (areaCode, parentCode) => {
    return request({
        url: "/api/blade-system/regioin/cityAreaTree",
        method: "get",
        params: {
            areaCode,
            parentCode
        }
    })
};

export const regionPermissionLazy = (parentCode) => {
    return request({
        url: '/api/blade-system/regioin/regionPermissionLazy',
        method: 'get',
        params: {
            parentCode
        }
    })
}


export const areaLazyTree = (parentCode) => {
  return request({
    url: '/api/blade-system/regioin/areaLazyTree2',
    method: 'get',
    params: {
      parentCode
    }
  })
}

export const getAreaCode = (parentCode) => {
  return request({
    url: '/api/blade-system/regioin/getAreaCode',
    method: 'get',
    params: {
      parentCode
    }
  })
}

export const getRegionList2 = (parentCode) => {
  return request({
    url: '/api/blade-system/regioin/regionList2',
    method: 'get',
    params: {
      parentCode
    }
  })
}
